package com.aqs;

/**
 * @author Zhang Zhe
 * @since 2020年02月18日 15:17:00
 */
public class AqsTest {



	public static void main(String[] args) {
		 Zlock zlock = new Zlock();
		 Thread [] threads = new Thread[10];
		for (int i = 0; i <10 ; i++) {
			threads[i] = new Thread(()->{
				try {
					zlock.lock();
					try {
						Thread.sleep(1000);
					} catch (InterruptedException e) {
						System.out.println("main:"+e.getMessage());;
					}
					System.out.println("hh");
				} finally {
					zlock.unlock();
				}
			});
		}

		for (int j = 0; j < 10; j++) {
			System.out.println("start"+j);
			threads[j].start();
		}

	}
}
